const express = require('express')
const router = express.Router()
const adminController = require('../controllers/adminController')
const { authenticate, isAdmin } = require('../middlewares/auth')

// 仪表盘数据统计
router.get('/dashboard/stats', authenticate, isAdmin, adminController.getDashboardStats)

// 资料管理
router.get('/materials', authenticate, isAdmin, adminController.getMaterials)
router.patch('/materials/:id/status', authenticate, isAdmin, adminController.updateMaterialStatus)
router.delete('/materials/:id', authenticate, isAdmin, adminController.deleteMaterial)

// 用户管理
router.get('/users', authenticate, isAdmin, adminController.getUsers)
router.patch('/users/:id/status', authenticate, isAdmin, adminController.updateUserStatus)

// 财务管理
router.get('/finance/recharges', authenticate, isAdmin, adminController.getRecharges)
router.get('/finance/consumptions', authenticate, isAdmin, adminController.getConsumptions)

// 操作日志
router.get('/logs', authenticate, isAdmin, adminController.getOperationLogs)

module.exports = router